home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
web
/
fweb
/
fweb-1.40
/
manual
/
fmanrefs.tex
< prev
next >
Wrap
Text File
|
1993-10-29
|
817b
|
49 lines
% Rudimentary Plain TeX referencing scheme for the manual.
\newcount\refnum
\newif\iffoundref
\def\lrefs{}
\newtoks\ta
\newtoks\tb
{\catcode`\_=11
\gdef\ismember#1\of#2{\foundreffalse
\refnum=0
\def\given{#1}%
\def\\##1{\advance\refnum by1%
\def\next{##1}\ifx\next\given
\foundreftrue
\fi}%
#2}
\gdef\testref#1{%
\ismember#1\of\lrefs
\iffoundref\else
\ta={\\#1}%
\tb=\expandafter{\lrefs}%
\xdef\lrefs{\the\tb\the\ta}%
\advance\refnum by1%
\fi
}
\gdef\cite#1{{%
\edef\next{\noexpand\testref{\expandafter\noexpand
\csname r_#1\endcsname}}\next
\refcite}}
\gdef\refcite{~[\the\refnum]}
\gdef\dref#1#2\par{\edef\next{\gdef\csname r_#1\endcsname{#2}}%
\next}
\gdef\manrefs{{\refnum=0
\def\\{\advance\refnum by1%
\xdef\cur_ref{\the\refnum}%
\medskip
\refcite\ignorespaces\ }\lrefs}}
}